package com.yc.favorite.mapper;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;

public interface TagFavoriteMapper {

    @Insert("insert into tagfavorite values(#{tid}, #{fid})")
    void insert(@Param("tid") Integer tid, @Param("fid")Integer fid);

    @Insert("INSERT INTO tagfavorite SELECT\n" +
            "   tid,\n" +
            "   #{fid}\n" +
            " FROM\n" +
            "   tag\n" +
            " WHERE\n" +
            " tname = #{tname}")
    void insertByTname(@Param("tname") String name, @Param("fid")Integer fid);

}
